<?php
/**
 * PlaceSearch.php
 * @author wuxin
 * @date 2020/8/10 17:36
 * @copyright xshoppy.com
 */

namespace backend\models\place;

use backend\models\search\SearchInterface;
use yii\data\ArrayDataProvider;

class PlaceSearch extends Place implements SearchInterface
{

    public function search(array $params = [], array $options = [])
    {
        $menus = $options['dataSource'];
        if( !$this->load($params) ) {
            return new ArrayDataProvider([
                'allModels' => $menus,
                'pagination' => [
                    'pageSize' => -1,
                ],
            ]);
        }
        return new ArrayDataProvider([
            'allModels' => $menus,
            'pagination' => [
                'pageSize' => -1,
            ],
        ]);
    }

}